.LemonMarkdown {
    overflow-wrap: anywhere;

    > * {
        margin: 0 0 0.5em;

        &:last-child {
            margin-bottom: 0;
        }
    }

    ol,
    ul,
    dl {
        padding-left: 1.5em;
    }

    ol {
        list-style-type: decimal;
    }

    ul {
        list-style-type: disc;
    }

    strong[level] {
        // Low-key headings
        display: block;
    }

    p {
        margin-bottom: 0.5em;
    }

    hr {
        margin: 1em 0;
    }

    h1,
    h2,
    h3,
    h4 {
        margin-bottom: 0.375em;
        font-weight: 600;
        line-height: 1.2;
        color: inherit;
    }

    h1,
    h2 {
        padding-bottom: 0.375em;
        border-bottom-width: 1px;

        &:not(:first-child) {
            margin-top: 0.75em;
        }
    }

    h1 {
        font-size: 1.375rem;
    }

    h2 {
        font-size: 1.125rem;
    }

    h3 {
        font-size: 1rem;
    }

    h4 {
        font-size: 0.875rem;
    }

    img {
        max-width: 100%;
    }

    blockquote {
        padding: 0.5em 1em;
        margin: 0.5em 0;
        color: var(--muted);
        background-color: var(--bg-light);
        border-left: 3px solid var(--border);

        p:last-child {
            margin-bottom: 0;
        }
    }

    // Table styling - minimal approach
    table {
        margin: 1em 0;
        overflow: auto;
        border-spacing: 0;
        border-collapse: separate;
        border: 1px solid var(--border);
        border-radius: var(--radius);
    }

    th,
    td {
        padding: 0.375rem 0.75rem;
        color: var(--default);
        text-align: left;
        vertical-align: top;
        border-right: 1px solid var(--border);
        border-bottom: 1px solid var(--border);

        &:last-child {
            border-right: none;
        }
    }

    th {
        font-weight: 600;
    }

    tbody tr:last-child td {
        border-bottom: none;
    }

    .LemonMarkdown__task {
        display: flex;
        gap: 0.5rem;
        align-items: center;
        list-style: none;

        .LemonCheckbox {
            flex-shrink: 0;
            margin-top: 0.125rem; // Slight adjustment to align with text
        }
    }

    .LemonMarkdown__task-content {
        flex: 1;
        min-width: 0; // Allow text to wrap
        // Remove edge paragraph margins in task items for better spacing
        p:first-child {
            margin-top: 0;
        }

        p:last-child {
            margin-bottom: 0;
        }
    }
}
